<template>
  <div>
    <div style="height: 40px">
      <h1 style="float: left">医生详情</h1>
      <el-button style="float: left; margin-left: 45%">审核</el-button>
      <el-button style="float: right" @click="back">返回</el-button>
      <div style="clear: both"></div>
    </div>
    <div>
      <table  border=1 cellpadding=8 cellspacing=0 style="margin-left: 0px; width: 100%" >
        <tr>
          <td colspan = "5">基本信息</td>
        </tr>
        <tr>
          <td rowspan="5" style="width:140px; padding: 0px 0px 0px 0px">
            <img :src="imageUrl" style="width:140px; margin: 0px" >
          </td>
          <td>ID</td>
          <td>{{ doctor.id }}</td>
          <td>姓名</td>
          <td>{{ doctor.name }}</td>
        </tr>
        <tr>
          <td>手机号</td>
          <td>{{ doctor.phone }}</td>
          <td>平台科室</td>
          <td>{{ doctor.platName }}</td>
        </tr>
        <tr>
          <td>性别</td>
          <td>{{ doctor.gender }}</td>
          <td>医院</td>
          <td>{{ doctor.hospitalName }}</td>
        </tr>
        <tr>
          <td>职称</td>
          <td>{{ doctor.platName }}</td>
          <td>医院科室</td>
          <td>{{ doctor.depTmName }}</td>
        </tr>
        <tr>
          <td>注册时间</td>
          <td>{{doctor.createTime}}</td>
          <td>银行卡号</td>
          <td>{{ doctor.accountNumber }}</td>
        </tr>
      </table>
    </div>
    <div style="border: solid 1px #ebebeb;">
      <div style="height: 45px; background-color: #f2f2f2; padding: 10px 0px 0px 10px">
        擅长
      </div>
      <div style="height: 60px; padding: 30px 0px 0px 10px">
        {{ doctor.googAt }}
      </div>
    </div>

    <div style="border: solid 1px #ebebeb;">
      <div style="height: 45px; background-color: #f2f2f2; padding: 10px 0px 0px 10px">
        简介
      </div>
      <div style=" padding: 10px 0px 10px 10px">
        {{doctor.briefIntr}}
      </div>
    </div>

    <div style="border: solid 1px #ebebeb;">
      <div style="height: 45px; background-color: #f2f2f2; padding: 10px 0px 0px 10px">
        服务
      </div>
      <div style="padding: 30px 0px 0px 10px">
        <div>图文问诊</div>
        <div>价格：￥{{GraphicConsultation.monty}}
          <span style="margin-right: 10px">接诊时间：{{ GraphicConsultation.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{ GraphicConsultation.consultNumber }}</span>
          <span>{{ GraphicConsultation.scheduleType }}</span>
        </div>

        <div style="margin-top: 10px">电话问诊</div>
        <div>价格：￥{{ TelephoneConsultation.monty }}
          <span style="margin-right: 10px">接诊时间：{{ TelephoneConsultation.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{TelephoneConsultation.consultNumber}}</span>
          <span>{{ TelephoneConsultation.scheduleType }}</span>
        </div>

        <div style="margin-top: 10px">视频问诊</div>
        <div>价格：￥{{ VideoConsultation.monty }}
          <span style="margin-right: 10px">接诊时间：{{ VideoConsultation.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{ VideoConsultation.consultNumber }}</span>
          <span>{{ VideoConsultation.scheduleType }}</span>
        </div>

        <div style="margin-top: 10px">极速问诊</div>
        <div>价格：￥{{ SpeedyConsultation.monty }}
          <span style="margin-right: 10px">接诊时间：{{ SpeedyConsultation.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{ SpeedyConsultation.consultNumber }}</span>
          <span>{{ SpeedyConsultation.scheduleType }}</span>
        </div>

        <div style="margin-top: 10px">挂号预约</div>
        <div>价格：￥{{ RegisterAppointment.monty }}
          <span style="margin-right: 10px">接诊时间：{{ RegisterAppointment.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{ RegisterAppointment.consultNumber }}</span>
          <span>{{ RegisterAppointment.scheduleType }}</span>
        </div>

        <div style="margin-top: 10px"> 复诊开药</div>
        <div>价格：￥{{ Prescribe.monty }}
          <span style="margin-right: 10px">接诊时间：{{ Prescribe.consultTime }}</span>
          <span style="margin-right: 10px">接诊人数：{{ Prescribe.consultNumber }}</span>
          <span>{{ Prescribe.scheduleType }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "DoctorInfo",
  data() {
    return {
     doctor: null,
      // 图片问诊
      GraphicConsultation: '',
      // 电话问诊
      TelephoneConsultation: '',
      // 视频问诊
      VideoConsultation: '',
      // 极速问诊
      SpeedyConsultation: '',
      // 挂号预约
      RegisterAppointment: '',
      // 复诊开药
      Prescribe: '',
      //头像地址
      imageUrl: '',
    };
  },
  methods: {
    back(){
      this.$router.go(-1)
    }
  },
  created() {
    this.doctor = this.$route.params.doctor
    this.imageUrl = "http://localhost:9527" +this.doctor.imgUrl

    this.$axios({
      method: 'GET',
      url: '/server/get/server',
      params: {
        id: this.doctor.id
      }
    }).then((data) => {
      let temp = data.data.data
      temp.forEach((obj) => {
        if (obj.consultType === '图文问诊') {
          this.GraphicConsultation = obj
        }else if (obj.consultType === '电话问诊') {
          this.TelephoneConsultation = obj
        }else if (obj.consultType === '视频问诊') {
          this.VideoConsultation = obj
        }else if (obj.consultType === '极速问诊') {
          this.SpeedyConsultation = obj
        }else if (obj.consultType === '挂号预约') {
          this.RegisterAppointment = obj
        }else if (obj.consultType === '复诊开药') {
          this.Prescribe = obj
        }
      })
    })
  }
}
</script>

<style scoped>

</style>
